Repository navigation
feat: the Android core comes from its release asset, pinned by version and checksum - #29
Merged
Merged
Conversation
…n and checksum The Android module took com.hotcodepush:core-android by full sha from core-android's maven branch, which every customer build read from raw.githubusercontent.com. It now takes the Maven-layout zip of the 0.1.0 release: package.json pins its version and SHA-256 under hotcodepush.coreAndroid, and scripts/download-core-android.mjs checks the checksum and unpacks it into an ignored local Maven repository that ships in the npm package. The script refuses a Gradle file that names another version than the pin, and the maven branch stays the development pin only. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…entral Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The Android downloader duplicates integrity-sensitive download and extraction logic and lacks regression tests for pin mismatches, checksum rejection, and cache hits.
2 open issues
What changed in this PR
This PR packages the Android native core with the React Native SDK, replacing Gradle downloads from the core’s development branch with a version- and checksum-pinned release asset.
Changes:
- Adds an Android core downloader with checksum verification, caching, and Gradle version validation.
- Includes the extracted Maven repository in the npm package and configures both Gradle scripts to use it.
- Updates build commands and contributor documentation for the bundled Android core.
| File | Description |
|---|---|
scripts/download-core-android.mjs |
Downloads, verifies, and extracts the pinned Android core. |
README.md |
Updates build instructions to mention both native cores. |
package.json |
Pins the Android core, packages its artifacts, and wires download commands. |
CLAUDE.md |
Documents release-asset pinning and local Maven resolution. |
android/hotcodepush.gradle |
Configures consuming apps to resolve the bundled core. |
android/build.gradle |
Uses the local Maven repository and core version 0.1.0. |
.gitignore |
Excludes downloaded Android core artifacts from version control. |
Review effort: Balanced
Comment on lines
+35
to
+38
| if (gradleVersion !== version) { | ||
| throw new Error( | ||
| `android/build.gradle names core-android ${gradleVersion}, package.json pins ${version}`, | ||
| ); |
Comment on lines
+53
to
+57
| const archive = Buffer.from(await response.arrayBuffer()); | ||
| const actualChecksum = createHash('sha256').update(archive).digest('hex'); | ||
| if (actualChecksum !== checksum) { | ||
| throw new Error( | ||
| `${url} has the checksum ${actualChecksum}, package.json pins ${checksum}`, |
commit: |
…m-the-release-asset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

com.hotcodepush:core-android:0.1.0, the Maven-layout zip of core-android's 0.1.0 release:core-android-0.1.0-maven.zip.package.jsonpins it underhotcodepush.coreAndroid: version0.1.0, SHA-2567c9b91381c5c99bf9e2592fd14e912972f0bb8f3df1b0a3c340a75ca5ef3a65b.scripts/download-core-android.mjsruns innpm run buildbeside the iOS download. It checks the checksum, unpacks the zip into the ignoredandroid/libs/m2, and skips the download while the pin is unchanged. It fails the build whenandroid/build.gradlenames another version than the pin.android/build.gradlereads the local repository for the library, andandroid/hotcodepush.gradlefor the app's:app, found beside the script file.raw.githubusercontent.com: Gradle resolves the core from the package's own files and only its transitive dependencies (OkHttp, okio, coroutines) from Maven Central.CLAUDE.mdnames the release asset and the checksum in the pin procedure, and themavenbranch as the development pin only.🤖 Generated with Claude Code